package com.gx.util.base;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

/**
 * @author gaoxing
 * @create 2018-05-26 上午10:17
 */
public class JsonUtils {
    private static final ObjectMapper mapper = new ObjectMapper();

    public static <T>T readValue(String json,Class<T> tClass){
        T t = null;
        try {
            t = mapper.readValue(json, tClass);
        } catch (IOException e) {
            return null;
        }
        return t;
    }
}
